package com.aaa.rent.controller.api;

import com.aaa.entity.Car;
import com.aaa.entity.CarType;
import com.aaa.rent.service.CarService;
import com.aaa.rent.service.CarTypeService;
import com.aaa.rent.service.CarVoService;
import com.aaa.rent.service.ShopService;
import com.aaa.vo.CarVo;
import com.aaa.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author wys
 * @version 1.0
 * @date 2023/3/2 14:32
 */
@Api(value = "rent/api/CarVoController", tags = {"api车辆vo控制"})
@RestController
@RequestMapping("rent/api/CarVoController")
public class ApiCarVoController {
    @Autowired
    private CarVoService carVoService;
    @Autowired
    private CarTypeService carTypeService;

    @Autowired
    private ShopService shopService;


    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "id", value = "", required = true)
    })
    @ApiOperation(value = "", notes = "", httpMethod = "GET")
    @GetMapping("delete")
    public Result delete(Integer id){
        return carVoService.delete(id);
    }


    //查询车辆类型
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "CarType", name = "carType", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "currentPage", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "pageSize", value = "", required = true)
    })
    @ApiOperation(value = "查询车辆类型", notes = "查询车辆类型")
    @RequestMapping("selectType")
    public Result selectType(CarType carType,Integer currentPage,Integer pageSize)
    {return carTypeService.selectCarType(carType,currentPage,pageSize);};

    //查询分店
    @ApiOperation(value = "查询分店", notes = "查询分店")
    @RequestMapping("selectShop")
    public Result selectShop(){return shopService.selectShop();}
}
